import com.ktjiaoyu.entity.SysUser;
import com.ktjiaoyu.service.SysUserService;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.List;

public class testImportResource {
    private static final Logger logger= LoggerFactory.getLogger(testImportResource.class);
    @Test
    public void test2() {
 // 加载入口类，通过入口类扫描包和加载配置文件
 ApplicationContext context = new
         AnnotationConfigApplicationContext(MatchException.class);
 // 获取 sysUserService 对象，此对象在 applicationContext-service.xml 中定义
 SysUserService userService = (SysUserService)
  context.getBean("sysUserService");
 // 查询用户列表
 List<SysUser> userList = userService.getSysUserList(null);
 // 简单演示效果，打印查到的用户数量即可
 logger.info("userList.size() = {}", userList.size());
    }
}
